<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>my blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="my blog">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="my blog">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="my blog">
  
    <link rel="alternate" href="/atom.xml" title="my blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
  

</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">my blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="Flux RSS"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Rechercher"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-How-to-create-personal-blog" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/01/16/How-to-create-personal-blog/" class="article-date">
  <time datetime="2017-01-16T03:45:40.000Z" itemprop="datePublished">2017-01-16</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/01/16/How-to-create-personal-blog/">How to create personal blog</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h3 id="1-新建仓库（OSchina）"><a href="#1-新建仓库（OSchina）" class="headerlink" title="1. 新建仓库（OSchina）"></a>1. 新建仓库（OSchina）</h3><h3 id="2-建站，前提（nodeJs，git），必备的应用程序"><a href="#2-建站，前提（nodeJs，git），必备的应用程序" class="headerlink" title="2.建站，前提（nodeJs，git），必备的应用程序"></a>2.建站，前提（nodeJs，git），必备的应用程序</h3><h3 id="3、安转hexo"><a href="#3、安转hexo" class="headerlink" title="3、安转hexo"></a>3、安转hexo</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install -g hexo-cli</div></pre></td></tr></table></figure>
<h3 id="4、init"><a href="#4、init" class="headerlink" title="4、init"></a>4、init</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo init &lt;folder&gt;</div></pre></td></tr></table></figure>
<p>生成如下目录：<br>    ├── _config.yml—–&gt;  网站配置信息<br>    ├── package.json—–&gt;  应用程序<br>    ├── scaffolds—–&gt;  模板文件夹<br>    ├── source—–&gt;  资源文件夹存放用户资源<br>    |   ├── _drafts<br>    |   └── _posts<br>    └── themes—–&gt;  主题</p>
<h3 id="5、安装依赖包"><a href="#5、安装依赖包" class="headerlink" title="5、安装依赖包"></a>5、安装依赖包</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> &lt;folder&gt;</div><div class="line">npm install</div></pre></td></tr></table></figure>
<h3 id="6、新建博客文章，（layout）文章的布局，默认为-post，可以通过修改-config-yml-中的default-layout-参数来指定默认布局。"><a href="#6、新建博客文章，（layout）文章的布局，默认为-post，可以通过修改-config-yml-中的default-layout-参数来指定默认布局。" class="headerlink" title="6、新建博客文章，（layout）文章的布局，默认为 post，可以通过修改 _config.yml 中的default_layout 参数来指定默认布局。"></a>6、新建博客文章，（layout）文章的布局，默认为 post，可以通过修改 _config.yml 中的default_layout 参数来指定默认布局。</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo new [layout] title</div></pre></td></tr></table></figure>
<p>若title有多个单词并且有空格组成，要打上引号，否则第一个单词就成为layout了</p>
<p>栗子：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo new <span class="string">"How to create personal blog"</span></div></pre></td></tr></table></figure></p>
<p>而非：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo new How to create personal blog</div></pre></td></tr></table></figure></p>
<h3 id="7、服务器，Hexo-3-0-把服务器独立成了个别模块，必须先安装-hexo-server-才能使用，安装完成后，输入hexo-server以启动服务器，您的网站会在-http-localhost-4000-下启动。在服务器启动期间，Hexo-会监视文件变动并自动更新，无须重启服务器。"><a href="#7、服务器，Hexo-3-0-把服务器独立成了个别模块，必须先安装-hexo-server-才能使用，安装完成后，输入hexo-server以启动服务器，您的网站会在-http-localhost-4000-下启动。在服务器启动期间，Hexo-会监视文件变动并自动更新，无须重启服务器。" class="headerlink" title="7、服务器，Hexo 3.0 把服务器独立成了个别模块，必须先安装 hexo-server 才能使用，安装完成后，输入hexo server以启动服务器，您的网站会在 http://localhost:4000 下启动。在服务器启动期间，Hexo 会监视文件变动并自动更新，无须重启服务器。"></a>7、服务器，Hexo 3.0 把服务器独立成了个别模块，必须先安装 hexo-server 才能使用，安装完成后，输入hexo server以启动服务器，您的网站会在 <a href="http://localhost:4000" target="_blank" rel="external">http://localhost:4000</a> 下启动。在服务器启动期间，Hexo 会监视文件变动并自动更新，无须重启服务器。</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">npm install hexo-server --save</div><div class="line">hexo server</div></pre></td></tr></table></figure>
<h3 id="8、部署，安装git插件–-gt"><a href="#8、部署，安装git插件–-gt" class="headerlink" title="8、部署，安装git插件–&gt;"></a>8、部署，安装git插件–&gt;</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm install hexo-deployer-git --save</div></pre></td></tr></table></figure>
<p>若是Rsync、OpenShift、FTPSync等，请看<a href="https://hexo.io/zh-cn/docs/deployment.html" target="_blank" rel="external">官方文档</a>,安装相应工具</p>
<h3 id="9、生成静态文件"><a href="#9、生成静态文件" class="headerlink" title="9、生成静态文件"></a>9、生成静态文件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo generate</div></pre></td></tr></table></figure>
<h3 id="10、部署"><a href="#10、部署" class="headerlink" title="10、部署"></a>10、部署</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">hexo deploy</div></pre></td></tr></table></figure>
<h3 id="11、可执行下列的其中一个命令，让-Hexo-在生成完毕后自动部署网站，两个命令的作用是相同的"><a href="#11、可执行下列的其中一个命令，让-Hexo-在生成完毕后自动部署网站，两个命令的作用是相同的" class="headerlink" title="11、可执行下列的其中一个命令，让 Hexo 在生成完毕后自动部署网站，两个命令的作用是相同的"></a>11、可执行下列的其中一个命令，让 Hexo 在生成完毕后自动部署网站，两个命令的作用是相同的</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">hexo generate --deploy</div><div class="line">hexo deploy --generate</div></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2017/01/16/How-to-create-personal-blog/" data-id="cixzvdorp0000q4mmq0xcnzjd" class="article-share-link">Partager</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/01/16/hello-world/" class="article-date">
  <time datetime="2017-01-16T03:03:05.743Z" itemprop="datePublished">2017-01-16</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/01/16/hello-world/">Hello World</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="external">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="external">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="external">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo new <span class="string">"My New Post"</span></div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="external">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo server</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="external">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo generate</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="external">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo deploy</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="external">Deployment</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2017/01/16/hello-world/" data-id="cixzvdos60001q4mmorexb6kw" class="article-share-link">Partager</a>
      
      
    </footer>
  </div>
  
</article>


  

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/">January 2017</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Articles récents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2017/01/16/How-to-create-personal-blog/">How to create personal blog</a>
          </li>
        
          <li>
            <a href="/2017/01/16/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2017 hzhu<br>
      Propulsé by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>